package com.emeth.utils
{
	public class StringUtils
	{
		public static function upperFirstChar(s:String):String
		{
			var c:String = s.charAt(0);
			
			return c.toUpperCase( ) + s.substr(1);
		} 
		
		/**
		 * clean Properties name
		 * ex : is_online, updated_at, etc...
		 * 
		 */ 
		public static function cleanPropertiesForPropel( s: String ) : String{
			var a : Array = s.split( "_" );
			if( a.length > 1 ){
				if( a[0] == 'is'){
					s = upperFirstChar( a[0] ) + upperFirstChar( a[1] );
				}
				if ( a[1] == 'at' || a[1] == 'id'){
					s = upperFirstChar( a[0] ) + upperFirstChar(a[1]);
				}
			} else {
				s = upperFirstChar(s);
			}
			
			return (s);
		}
		
		public static function cleanPropertiesForDoctrine( s: String ) : String{			
			return (s);
		}
		
	}
}